package ch03.cat;

public class IntermediaryCat implements Cat{
    private Cat cat;
    public IntermediaryCat(RealCat cat){
        this.cat=cat;
    }
    @Override
    public String haveaCat() {
        defore();
        String msg=cat.haveaCat();
        after();
        return msg;
    }
    public void defore(){
        for (int i=0;i<3;i++){
            System.out.println("第"+(i+1)+"次看车");
        }
    }
    public void after(){
        System.out.println("付款成功");
    }}
